home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Interactive 4
/
PC World Interactive 4.iso
/
share
/
internet
/
LSMIRC61.EXE
/
evmisc.in_
/
evmisc.in
Wrap
INI File
|
1997-09-21
|
20KB
|
472 lines
[script]
n0=;
n1=; this section deals with miscellaneous events, including idle checking,
n2=; nick changes and on invites and associated tasks, such as excessive
n3=; nick change detection
n4=;
n5=alias cycleops {
n6= %t = 0
n7= :nx
n8= inc %t
n9= if $chan(%t) != $null {
n10= if (($nick($chan(%t),0) = 1) && ($me !isop $chan(%t))) {
n11= altech -s %dis10 $+ Cycling $chan(%t) to gain ops
n12= part $chan(%t) | .timer 1 3 join $chan(%t)
n13= }
n14= goto nx
n15= }
n16=}
n17=alias checkidlers {
n18= %j = 0
n19= :nx
n20= inc %j
n21= set %nick $nick($1,%j)
n22= if %nick != $null {
n23= if ($notfriend(%nick,$1)) {
n24= set %lastspoke $readini $mircdiridle.ini $1 %nick
n25= if %lastspoke != $null {
n26= %spoke = $ctime - %lastspoke
n27= if (%spoke > %idlekickafter [ $+ [ $1 ] ] ) kick $1 %nick idle $dur(%lastspoke)
n28= }
n29= else writeini $mircdiridle.ini $1 %nick $ctime
n30= }
n31= goto nx
n32= }
n33=}
n34=alias idlecheck {
n35= %k = 0
n36= :nx
n37= inc %k
n38= if $chan(%k) != $null {
n39= if (($me isop $chan(%k)) && (%idlekick [ $+ [ $chan(%k) ] ] )) checkidlers $chan(%k)
n40= goto nx
n41= }
n42=}
n43=alias nctxt if (%urd) { z | echo 3 $me $1 is now known as $2 }
n44=alias checknickflood {
n45= ; given nick $1, should I even care about nick change floods
n46= ; based off the options for the channel he/she is on? ($true/$false)
n47= %k = 0
n48= :nx
n49= inc %k
n50= set %chan $comchan($1,%k)
n51= if %chan != $null {
n52= if ((%nickflood [ $+ [ %chan ] ] ) && ($me isop %chan) && ($notfriend($1,%chan))) return $true
n53= if ((%haveoptions [ $+ [ %chan ] ] = $null) && (%nickfloodother) && ($me isop %chan) && ($notfriend($1,%chan))) return $true
n54= goto nx
n55= }
n56= return $false
n57=}
n58=alias fservnum {
n59= ; if nick $1 is in fserv, return the fserv window number?
n60= ; if nick isn't in fserv, return 0
n61= %i = 0
n62= :nx
n63= inc %i
n64= if $fserv(%i) != $null {
n65= if $fserv(%i) = $1 return %i
n66= goto nx
n67= }
n68= return 0
n69=}
n70=alias fsady return %fsady [ $+ [ $1 ] ]
n71=alias fservcredits {
n72= ; how many fserv credits does the address that belongs to nick $1 have?
n73= if %fservcredits [ $+ [ $fsady($1) ] ] = $null return 0
n74= else return %fservcredits [ $+ [ $fsady($1) ] ]
n75=}
n76=on 1:SERVOPEN:{
n77= msg =$nick 12,0Hello $nick
n78= if (%fsenforceratio) {
n79= msg =$nick 2,0Current byte ratio:12,0 1 upload to %fservratio download.
n80= if $fservcredits($nick) = 0 {
n81= msg =$nick 2,0Your credits:12,0 %startingcredits bytes
n82= set %fservcredits [ $+ [ $fsady($nick) ] ] %startingcredits
n83= }
n84= else msg =$nick 2,0Your credits:12,0 $fservcredits($nick) bytes
n85= msg =$nick 12,0This is a byte ratio, not a file ratio!
n86= }
n87= else msg =$nick 12,0There is currently no ratio being enforced.
n88=}
n89=on 1:SERVCLOSE:close -f $nick
n90=on 1:SERV:get*:{
n91= set %fnum $fservnum($nick)
n92= if %fnum = 0 halt
n93= set %file $fserv(%fnum).cd $+ \ $+ $2
n94= set %bytes $lof(%file)
n95= if %bytes = $null { msg =$nick 4,0No such file:3,0 $2 | halt }
n96= if (%fsenforceratio) {
n97= if %bytes > $fservcredits($nick) {
n98= msg =$nick 2,0Sorry, you do not have enough credit for that file
n99= msg =$nick 2,0 $+ $2 $+ :12,0 %bytes bytes
n100= msg =$nick 2,0Your Credit:12,0 $fservcredits($nick) bytes
n101= }
n102= else {
n103= msg =$nick 4,0Sending file:3,0 $2 ( $+ %bytes bytes)
n104= dcc send $nick $fserv(%fnum).cd $+ \ $+ $2
n105= dec %fservcredits [ $+ [ $fsady($nick) ] ] %bytes
n106= msg =$nick 2,0Remaining Credit:12,0 $fservcredits($nick) bytes
n107= }
n108= }
n109= else {
n110= msg =$nick 4,0Sending file:3,0 $2 ( $+ %bytes bytes)
n111= dcc send $nick $fserv(%fnum).cd $+ \ $+ $2
n112= }
n113= halt
n114=}
n115=on 1:FILERCVD:*:{
n116= if (%tvgot [ $+ [ $nopath($filename) ] ] ) {
n117= dde control $ddename copyfile $filename $+ @ $+ $wavedir $+ $nopath($filename)
n118= unset %tvgot [ $+ [ $nopath($filename) ] ]
n119= }
n120= elseif ($fserv($nick) != $null) {
n121= set %bytes $lof($filename)
n122= if %bytes != $null msg =$nick 4,0Received:3,0 $filename 3,0( $+ %bytes bytes)
n123= if (%fsenforceratio) {
n124= inc %fservcredits [ $+ [ $fsady($nick) ] ] $calc(%fservratio * %bytes)
n125= msg =$nick 2,0New Credit:12,0 $fservcredits($nick) bytes
n126= }
n127= }
n128=}
n129=on 1:GETFAIL:if (%tvgot [ $+ [ $nopath($filename) ] ] ) unset %tvgot [ $+ [ $nopath($filename) ] ]
n130=on 1:INPUT:{
n131= if (($chr(35) isin $active) && ($right($1,1) = :)) {
n132= ; nick completion section
n133= if ($right($1,2) = ::) set %find * $+ $replace($1,::,*!*@*)
n134= else set %find * $+ $replace($1,:,*!*@*)
n135= if $len(%find) = 6 { say $1- | halt }
n136= set %fnick $ialchan(%find,$active,1).nick
n137= if %fnick != $null {
n138= if ($right($1,2) = ::) say %ncstart $+ %fnick $+ %ncend $2-
n139= else say %fnick $+ : $2-
n140= halt
n141= }
n142= }
n143= if (($server != $null) && (%autoaway)) {
n144= if ((%autoset) && ($away)) { altech -a 3Telling the server you are no longer away... | set %autoset $false | away }
n145= autoaway
n146= }
n147=}
n148=#regdns on
n149=on 1:DNS: {
n150= altech -a %dis38 $+ *** DNS report for: $+ %dis39 $nick
n151= altech -a %dis38 $+ *** Address: $+ %dis39 $address
n152= if $raddress = $null altech -a %dis38 $+ *** Could not resolve
n153= else altech -a %dis38 $+ *** Resolved: $+ %dis39 $raddress
n154=}
n155=#regdns end
n156=#telnetdns off
n157=on 1:DNS: {
n158= .disable #telnetdns | .enable #regdns
n159= if ($isnumericip($raddress)) telnet $nick $raddress
n160= elseif ($isnumericip($address)) telnet $nick $address
n161= else echo 4 -a Could not determine IP for $nick
n162=}
n163=#telnetdns end
n164=alias indcc {
n165= ; is IP $1 in any type of DCC? ($true/$false)
n166= if $fserv($1) != $null return $true
n167= if $get($1) != $null return $true
n168= if $send($1) != $null return $true
n169= if $chat($1) != $null return $true
n170= return $false
n171=}
n172=alias goticmp {
n173= if ($indcc($1)) halt
n174= if (($1 iswm %wmip) || (%wmip iswm $1)) halt
n175= if (%tvjustgot [ $+ [ $1 ] ] ) halt
n176= set %tvjustgot [ $+ [ $1 ] ] $true
n177= .timer 1 300 unset %tvjustgot [ $+ [ $1 ] ]
n178= echo -a %dis24 $+ -ICMP Detector- %dis25 $+ ICMP detected from: $1
n179= inc %fnum | set %findnick [ $+ [ %fnum ] ] $1
n180= .timer38 1 1 findit
n181=}
n182=alias matchnick if %matchnick != $null dde $1 $ddename txtNick %matchnick
n183=alias findit {
n184= :nx
n185= inc %findnum | set %ip %findnick [ $+ [ %findnum ] ]
n186= if ((%ip != $null) && (%findnum <= %fnum)) {
n187= if (%justfound [ $+ [ %ip ] ] ) goto nx
n188= set %justfound [ $+ [ %ip ] ] $true
n189= .timer 1 900 unset %justfound [ $+ [ %ip ] ]
n190= set %matchnick $ial( [ [ * ] $+ [ %ip ] ] ,1).nick
n191= if %matchnick = $null { .enable #findmatch | .disable #regdns | .dns %ip }
n192= else {
n193= echo -a %dis24 $+ -ICMP Detector- %dis25 $+ matched %ip to nick: %matchnick
n194= .timer 1 2 findit
n195= }
n196= }
n197= else { unset %findnick* | unset %findnum | unset %fnum }
n198=}
n199=alias findit2 {
n200= :nx
n201= inc %findnum2 | set %ip %findnick2 [ $+ [ %findnum2 ] ]
n202= if ((%ip != $null) && (%findnum2 <= %fnum2)) {
n203= set %matchnick $ial( [ [ * ] $+ [ %ip ] ] ,1).nick
n204= if %matchnick = $null { .enable #findmatch2 | .disable #regdns | .dns %ip }
n205= else {
n206= echo -a %dis24 $+ -Connection Monitor- %dis25 $+ matched %ip to nick: %matchnick
n207= .timer 1 2 findit2
n208= }
n209= }
n210= else { unset %findnick2* | unset %findnum2 | unset %fnum2 }
n211=}
n212=#scanlookup off
n213=on 1:DNS: {
n214= .disable #scanlookup | .enable #regdns
n215= if $raddress = $null dde icmpdet $ddename gotip Could not resolve
n216= else {
n217= dde icmpdet $ddename gotip $raddress
n218= if %matchnick = $null {
n219= set %matchnick $ial( [ [ * ] $+ [ $raddress ] ] ,1).nick
n220= if %matchnick = $null dde icmpdet $ddename txtNick None Found
n221= else dde icmpdet $ddename txtNick %matchnick
n222= }
n223= }
n224=}
n225=#scanlookup end
n226=#findmatch off
n227=on 1:DNS: {
n228= .disable #findmatch | .enable #regdns | .timer 1 20 .disable #findmatch
n229= set %matchnick $ial( [ [ * ] $+ [ $raddress ] ] ,1).nick
n230= if %matchnick != $null echo -a %dis24 $+ -ICMP Detector- %dis25 $+ matched %ip to nick: %matchnick
n231= else echo -a %dis24 $+ -ICMP Detector- %dis25 $+ could not find a match for %ip on local channels
n232= .timer 1 2 findit
n233=}
n234=#findmatch end
n235=#match off
n236=on 1:DNS: {
n237= .disable #match | .enable #regdns
n238= if $raddress != $null {
n239= altech -a %dis10 $+ Resolved %mip to $raddress
n240= if ($ial( [ [ * ] $+ [ $raddress ] ] ,1).nick != $null) altech -a %dis10 $+ Matched %mip to nick: $ial( [ [ * ] $+ [ $raddress ] ] ,1).nick
n241= else {
n242= altech -a %dis10 $+ Could not find a match for %mip on local channels
n243= altech -a %dis10 $+ Press Shift-F1 to do a /who on this address
n244= set %tvmip * $+ $raddress
n245= }
n246= }
n247= else altech -a %dis10 $+ Could not resolve %mip
n248=}
n249=#match end
n250=#findmatch2 off
n251=on 1:DNS: {
n252= .disable #findmatch2 | .enable #regdns | .timer 1 20 .disable #findmatch2
n253= set %matchnick $ial( [ [ * ] $+ [ $raddress ] ] ,1).nick
n254= if %matchnick != $null echo -a %dis24 $+ -Connection Monitor- %dis25 $+ matched %ip to nick: %matchnick
n255= else echo -a %dis24 $+ -Connection Monitor- %dis25 $+ could not find a match for %ip
n256= .timer 1 2 findit2
n257=}
n258=#findmatch2 end
n259=#connectionlookup off
n260=on 1:DNS: {
n261= .disable #connectionlookup | .enable #regdns
n262= if $raddress = $null dde monitor $ddename gotip Could not resolve
n263= else {
n264= dde monitor $ddename gotip $raddress
n265= if %matchnick = $null {
n266= set %matchnick $ial( [ [ * ] $+ [ $raddress ] ] ,1).nick
n267= if %matchnick = $null dde monitor $ddename txtNick None Found
n268= else dde monitor $ddename txtNick %matchnick
n269= }
n270= }
n271=}
n272=#connectionlookup end
n273=; /* if I'm doing a nick flood, keep track of when I'm done so I know when
n274=; to take my nick back */
n275=#nflood off
n276=on +70:NICK:inc %fc | if %fc = %ch { nick %me | .disable #nflood }
n277=#nflood end
n278=on 1:NOTIFY:{
n279= if (%doneinit) speak $nick is on IRC
n280= if (%altnotify) {
n281= set %tvnotify [ $+ [ $nick ] ] $true | userhost $nick
n282= .timer 1 5 unset %tvnotify [ $+ [ $nick ] ]
n283= }
n284= halt
n285=}
n286=on 1:UNOTIFY:if (%altnotify) { altech -a %dis1 $+ *** $nick has left IRC | halt }
n287=on 1:TOPIC:#:{
n288= if (%urd) { z | echo 1 $me $chan $+ : $nick changes topic to " $+ $parms $+ " }
n289= if (($nick = $me) || ((+t isin $chan($chan).mode) && ($me !isop $chan))) halt
n290= if ((%tvlocktopic [ $+ [ $chan ] ] ) && ($1- != %tvtopic [ $+ [ $chan ] ] )) {
n291= if %tvtopic [ $+ [ $chan ] ] != $null topic $chan %tvtopic [ $+ [ $chan ] ]
n292= }
n293=}
n294=;
n295=; invite routine when you're opped
n296=;
n297=on 1:INVITE:#:{
n298= if (%urd) { z | echo 3 $me You have been invited to $chan by $nick }
n299= set %inv $chan | set %ivn $nick | set %iva $a3($nick) | if %iva = $null set %iva $mask( [ $fulladdress ] ,3)
n300= .timer 1 60 unset %inv | .timer 1 60 unset %ivn
n301= if $ulevel != 70 tignore i 30 $mask( [ $fulladdress ] ,3)
n302= if $ulevel > 18 echo 3 -a You have been invited to $chan by $nick (recognized)
n303= else echo 3 -a You have been invited to $chan by $nick (un-recognized)
n304= echo 4 -a Press Shift-F6 to join $chan
n305= if $ulevel < 18 {
n306= if (%invite) {
n307= if $comchan($nick,0) != 0 {
n308= %i = 0
n309= :nx
n310= inc %i
n311= if $chan(%i) != $null {
n312= if (($me isop $chan(%i)) && ($nick ison $chan(%i))) {
n313= echo $chan(%i) %dis3 $+ Invites suck! %dis4 Kicking $nick for inviting you to $chan
n314= kickban $a3($nick) $chan(%i) %invitemsg
n315= rtb $a3($nick) $chan(%i)
n316= }
n317= goto nx
n318= }
n319= }
n320= }
n321= elseif $a3($nick) != $null echo 4 -a Press Shift-F5 to kick-ban $nick
n322= }
n323= alert
n324=}
n325=;
n326=; on nicks
n327=;
n328=on +70:NICK:{
n329= if ((%ak) && ($newnick = ElmerFudd)) { $readini $mircdirmisc.ini kicks 42 | set %ak $false }
n330= if ((%tvsettingaway) && ($newnick = %tvawaynick)) { unset %tvsettingaway | setaway %awayreason }
n331= else {
n332= .ruser $nick | .auser 70 $newnick | nctxt $nick $newnick
n333= set %myadr $replace(%myadr,$nick,$newnick)
n334= if ((%getnick) && ($newnick != %mynick) && (%dontcare != $true)) getnick
n335= }
n336=}
n337=on 1!:NICK:{
n338= nctxt $nick $newnick
n339= if ($checknickflood($newnick)) {
n340= inc %tvnchg [ $+ [ $site ] ]
n341= .timer 1 %nickin unset %tvnchg [ $+ [ $site ] ]
n342= if (%tvnchg [ $+ [ $site ] ] >= %nickis) {
n343= %i = 0
n344= :nx
n345= inc %i
n346= if $chan(%i) != $null {
n347= if (($notfriend($newnick,$chan(%i))) && ($newnick ison $chan(%i))) kickbanall $a3($newnick) $chan(%i) %nickfloodmsg
n348= goto nx
n349= }
n350= if (%ekick) altech -a %dis3 $+ Nick Changed Flood Detected! %dis4 $+ Banning $newnick ( $+ $a3($newnick) $+ )
n351= if (%snick = ding) ding
n352= elseif (%snick = speak) speak nick flood detected, kicking $newnick
n353= elseif (%snick != none) splay %snick
n354= }
n355= elseif (%eflood) altech -s %dis16 $+ Nick change flood detector watching $newnick %dis17 $+ (offense %tvnchg [ $+ [ $site ] ] $+ )
n356= }
n357= %m = 0
n358= :nx2
n359= inc %m
n360= if $chan(%m) != $null {
n361= if (%idlekick [ $+ [ $chan(%m) ] ] ) {
n362= set %temp $readini $mircdiridle.ini $chan(%m) $nick
n363= if %temp = $null set %temp $ctime
n364= remini $mircdiridle.ini $chan(%m) $nick
n365= writeini $mircdiridle.ini $chan(%m) $newnick %temp
n366= }
n367= goto nx2
n368= }
n369=}
n370=on +17:NICK:.auser 17 $newnick | .timer 1 30 .ruser 17 $newnick | .ruser 17 $nick
n371=on +18:NICK:.auser 18 $newnick | .timer 1 30 .ruser 18 $newnick | .ruser 18 $nick
n372=;
n373=; #MockLamer stuff
n374=;
n375=on 1:TEXT:|mocklamer request|*:#mocklamer: {
n376= if (%mocklamer) raw -q notice $nick :LamerMocking is active
n377= else raw -q notice $nick :LamerMocking is currently not active
n378=}
n379=on 1:TEXT:|mocklamer*:#mocklamer: {
n380= if (%mocklamer) {
n381= inc %mocks | .timer 1 10 unset %mocks
n382= if %mocks > 5 {
n383= ; don't send more than 5 in 10 seconds so you won't flood yourself
n384= if (%tvsentnotice [ $+ [ $mask( [ $fulladdress ] ,3 ) ] ] != $true) {
n385= ; if I didn't just send this person a notice, send him one saying that I'm busy
n386= ; I'm doing this so you can't be made to flood yourself with the "try again later" notices
n387= ; lets not be fooled by clones... check by user@*.domain address
n388= ; if I have sent this notice recently, just ignore the request quietly
n389= set %tvsentnotice [ $+ [ $mask( [ $fulladdress ] ,3 ) ] ] $true
n390= .timer 1 10 unset %tvsentnotice [ $+ [ $mask( [ $fulladdress ] ,3 ) ] ]
n391= raw -q notice $nick :Sorry, there's too many lamers out there... try again in a few seconds!
n392= echo 4 #MockLamer Ignoring mock reqest by $nick 3,0(flood protection)
n393= }
n394= }
n395= else {
n396= ; verify that the lamer, $2, is actually on IRC... turn it over to raw.ini
n397= if (%tvrequested [ $+ [ $2 ] ] ) {
n398= if (%tvsentnogo [ $+ [ $mask( [ $fulladdress ] ,3 ) ] ] != $true) {
n399= set %tvsentnogo [ $+ [ $mask( [ $fulladdress ] ,3 ) ] ] $true
n400= .timer 1 15 unset %tvsentnogo [ $+ [ $mask( [ $fulladdress ] ,3 ) ] ]
n401= raw -q notice $nick :Sorry, a mock was just sent to $2 recently
n402= echo 4 #MockLamer Ignoring request to mock $2 (just mocked)
n403= }
n404= else echo 4 #MockLamer Ignoring request to mock $2 (just mocked) 3,0(repetitive request)
n405= }
n406= else {
n407= set %tvrequested [ $+ [ $2 ] ] $true
n408= .timer 1 15 unset %tvrequested [ $+ [ $2 ] ]
n409= set %tvmocker [ $+ [ $2 ] ] $nick | .enable #verifylamer | set %mockee $2 | userhost $2
n410= }
n411= }
n412= }
n413= else echo 4 #MockLamer MockLamer ignored 3,0(it's off!)
n414=}
n415=;
n416=; the next few go along with action kicks
n417=;
n418=on +17:OP:#:{
n419= describe $chan suddenly remembers that in $chan we don't op ASSHOLES!!!
n420= mode $chan -o+b $opnick $a3($opnick)
n421= kick $chan $opnick Go get ops in #Assholes!!!
n422= rtb $a3($opnick) $chan
n423= .ruser $opnick
n424=}
n425=on +18:OP:#:{
n426= describe $chan suddenly remembers that in $chan we don't op ASSHOLES!!!
n427= mode $chan -o $opnick | kick $chan $opnick Go get ops in #Assholes!!! | .ruser $opnick
n428=}
n429=#regctcp on
n430=on 1:CTCPREPLY:*:{
n431= if ($1 = PING) {
n432= if (%acPING) echo 4 -a [[ $+ $nick PING reply]: $dur2($calc($ctime - $2))
n433= else echo 4 -s [[ $+ $nick PING reply]: $dur2($calc($ctime - $2))
n434= if ((%redirect) && ($me ison %rchan) && ($nick ison %rchan)) msg %rchan [[ $+ $nick PING reply]: $dur2($calc($ctime - $2))
n435= if $nick = %pingnick { unset %pingnick | raw -q notice $nick :Your ping reply is: $dur2($calc($ctime - $2)) }
n436= }
n437= elseif (($ulevel > 18) && ($1 = flood_alert)) {
n438= echo 4 -s [[ $+ $nick $1 reply $+ ]]: $2-
n439= echo 5 -s Adding $6 to ignore list for 60 seconds
n440= .ignore -t $6 | .timer 1 60 .ignore -r $6
n441= }
n442= else {
n443= if (%ac [ $+ [ $1 ] ] ) echo 4 -a [[ $+ $nick $1 reply]: $2-
n444= else echo 4 -s [[ $+ $nick $1 reply]: $2-
n445= }
n446= halt
n447=}
n448=#regctcp end
n449=on 70:CTCPREPLY:*:{
n450= if ($1 = LAGCHECK) {
n451= if (($usermodes = $null) || ($usermodes = +)) titlebar Little Star 6.1 $me on $server $+ : $+ $port Lag: $calc($ctime - $2) secs
n452= else titlebar Little Star 6.1 $me $usermodes on $server $+ : $+ $port Lag: $calc($ctime - $2) secs
n453= if ($calc($ctime - $2) > %exclagis) { echo 4 -a Excessive Lag Detected ( $+ $dur2($calc($ctime - $2)) $+ ) on $server $+ : $port | alert }
n454= }
n455= elseif ($1 = flood_alert) {
n456= echo 4 -s [[ $+ $nick $1 reply $+ ]]: $2-
n457= echo 5 -s Adding $6 to ignore list for 60 seconds
n458= .ignore -t $6 | .timer 1 60 .ignore -r $6
n459= }
n460= elseif ($1 = PING) {
n461= if (%acPING) echo 4 -a [[ $+ $nick PING reply]: $dur2($calc($ctime - $2))
n462= else echo 4 -s [[ $+ $nick PING reply]: $dur2($calc($ctime - $2))
n463= }
n464= else {
n465= if (%ac [ $+ [ $1 ] ] ) echo 4 -a [[ $+ $nick $1 reply]: $2-
n466= else echo 4 -s [[ $+ $nick $1 reply]: $2-
n467= }
n468= halt
n469=}